﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FinosLibrary;
using System.IO;
using System.Windows.Media;
namespace FinosAdmin.Logics {
    [MessageProcess]
    public class Other:ModelLogic {
        public RadialGradientBrush light { get; set; }
        public string sdkPath;
        [MessageMethod]
        public void GetSDK(string path) {
            sdkPath = path;
            connection.byteHead = "GetingSDK";
            call("GetSDK");
        }
        [MessageMethod]
        public void GetingSDK(Package p) {
            connection.byteHead = null;
            File.WriteAllBytes(sdkPath, p.byteBody);
        }
        [MessageMethod]
        public override void NetConnection_Connected() {
            base.NetConnection_Connected();
            light = resource["greenlight"] as RadialGradientBrush;
            this.NotifyPropertyChanged(x => x.light);
        }
        [MessageMethod]
        public override void NetConnection_Disconnected(string reason) {
            base.NetConnection_Disconnected(reason);
            light = resource["redlight"] as RadialGradientBrush;
            this.NotifyPropertyChanged(x => x.light);
        }
    }
}
